﻿<%@ Page Language="C#" MasterPageFile="~/Navigations.Master" AutoEventWireup="true" CodeBehind="KefuManager.aspx.cs" Inherits="WeChat.Manager.KefuManages" Title="客服管理" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" language="javascript">
        function tips(){
            $("#mysTip").modal("show");
        }
        function clean(){
            $("[name='accounts']").val("");
            $("[name='nick']").val("");
            $("[name='password']").val("");
        }
        function clean2(){
            $("[name='accountsAt']").val("");
            $("[name='nicksAt']").val("");
            $("[name='passwordAt']").val("");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
      <div class="container">
      <div class="row">
        <div class="col-md-1"></div>
        <div class="col-md-5">
            <div class="panel panel-info">
               <div class="panel-heading">
                  <h3 class="panel-title">新增客服 &nbsp;&nbsp;<asp:Label ID="Label2" runat="server" Text="(账号末尾必须添加‘@+公众号英文名’)" 
                          Font-Size="Small" ForeColor="#A94442"></asp:Label></h3>
               </div>
               <div class="panel-body">
                           <div class="form-group">
                              <label for="name" class="col-md-3 control-label">账号</label>
                              <div class="col-md-9">
                                 <input type="text" name="accounts" class="form-control" placeholder="请输入客服账号"/>
                              </div>
                           </div>
                            <div class="form-group">
                              <label for="firstname" class="col-md-3 control-label">昵称</label>
                              <div class="col-md-9">
                                 <input type="text" name="nick" class="form-control" placeholder="请输入客服昵称"/>
                              </div>
                           </div>
                           <div class="form-group">
                              <label for="lastname" class="col-md-3 control-label">密码</label>
                              <div class="col-md-9">
                                 <input type="password" name="password" class="form-control" placeholder="请输入客服密码"/>
                              </div>
                           </div>
               </div>
               <div class="panel-footer text-right">
                  <asp:Button ID="save1" class="btn btn-primary" runat="server" Text="保存" OnClick="addKf" />
                   <input id="Button3" type="button" class="btn btn-warning" value="清空" onclick="clean()" />
               </div>
            </div>
       </div>
       
       <div class="col-md-5">
            <div class="panel panel-info">
               <div class="panel-heading">
                  <h3 class="panel-title">修改客服</h3>
               </div>
               <div class="panel-body">
                           <div class="form-group">
                              <label for="name" class="col-md-3 control-label">账号</label>
                              <div class="col-md-9">
                                 <input type="text" name="accountsAt" class="form-control" placeholder="请输入要修改的客服账号"/>
                              </div>
                           </div>
                            <div class="form-group">
                              <label for="firstname" class="col-md-3 control-label">新昵称</label>
                              <div class="col-md-9">
                                 <input type="text" name="nicksAt" class="form-control" placeholder="请输入新的客服昵称"/>
                              </div>
                           </div>
                           <div class="form-group">
                              <label for="lastname" class="col-md-3 control-label">新密码</label>
                              <div class="col-md-9">
                                 <input type="password" name="passwordAt" class="form-control" placeholder="请输入新的客服密码"/>
                              </div>
                           </div>
               </div>
               <div class="panel-footer text-right">
                  <asp:Button ID="newInfo" class="btn btn-primary" runat="server" Text="保存" OnClick="alterKf" />
                   <input id="Button2" type="button" class="btn btn-warning" value="清空" onclick="clean2()" />
               </div>
            </div>
       </div>
      <div class="col-md-1"></div>
    </div>
    </div>
    <!---------------分界线--------------->
<div class="container">
      <div class="row">
        <div class="col-md-1"></div>
        <div class="col-md-6">
            <div class="panel panel-danger">
               <div class="panel-heading">
                  <h3 class="panel-title">查看所有客服</h3>
               </div>
               <div class="panel-body">
               <div class="form-group">
                      <div class="col-md-4">
                         <asp:Button ID="Button1" class="btn btn-primary" runat="server" Text="查看客服" OnClick="shows" />
                      </div>
                       <div class="col-md-5 col-xs-7">
                         <input type="text" name="newpwd" class="form-control" placeholder="请输入初始化密码"/>
                      </div>
                        
                      <div class="col-md-3 col-xs-5">
                         <asp:Button ID="Synchronous" class="btn btn-primary" runat="server" Text="同步数据" OnClick="Restart_syn" />
                      </div>
               </div>
                
           </div>
           <asp:Repeater id="showKefus" runat="server" onitemcommand="showKefus_ItemCommand">
                    <HeaderTemplate>
                    <table class="table table-hover">
                    <tr>
                    <th>客服账号</th>
                    <th>客服昵称</th>
                    <th>操作</th>
                    </tr>
                    </HeaderTemplate>

                    <ItemTemplate>
                    <tr>
                    <td><%# Eval("kf_account")%></td>
                    <td><%# Eval("kf_nick")%></td>
                    <td><asp:ImageButton ID="kefudel" runat="server" CommandArgument='<%# Eval("kf_account")%>' CssClass="btn" Height="27px" 
                    OnClientClick='return confirm("确认要删除吗？")' CommandName="delete" ImageUrl="~/images/del.jpg" ToolTip="删除" /></td>
                        
                    </tr>
                    </ItemTemplate>

                    <FooterTemplate>
                    </table>
                    </FooterTemplate>
                 </asp:Repeater>
            </div>
       </div>
      <!---------------分界线--------------->  
       <div class="col-md-4">
            <div class="panel panel-danger">
               <div class="panel-heading">
                  <h3 class="panel-title">查看在线客服</h3>
               </div>
               <div class="panel-body">
                <div class="form-group">
                      <div class="col-md-4 ">
                         <asp:Button ID="Button4" class="btn btn-primary" runat="server" Text="查看客服" OnClick="showkfOL" />
                      </div>
                      <div class="col-md-8 "> <asp:Label ID="Label3" runat="server" ForeColor="Red"></asp:Label></div>
               </div>
               </div>
           <asp:Repeater id="Repeater1" runat="server">
                    <HeaderTemplate>
                    <table class="table table-hover">
                    <tr>
                    <th>客服账号</th>
                    <th>在线状态</th>
                    <th>正在接待</th>
                    </tr>
                    </HeaderTemplate>

                    <ItemTemplate>
                    <tr>
                    <td><%# Eval("kf_account")%></td>
                    <td><%# Eval("status")%></td>
                    <td><%# Eval("accepted_case")%></td>
                    </tr>
                    </ItemTemplate>

                    <FooterTemplate>
                    </table>
                    </FooterTemplate>
                 </asp:Repeater>
            </div>
       </div>
      <div class="col-md-1"></div>
    </div>
    </div>
    
    
   <!--rating modal's content-->
<div class="modal fade" id="mysTip" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
          <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4>提示</h4>
            </div><!--Modal header-->
            <div class="modal-body"><h3><asp:Label ID="Label1" runat="server"></asp:Label></h3>
            </div><!--Modal body-->
            <div class="modal-footer">
              <a href="#" class="btn btn-default" data-dismiss="modal" >关闭</a>
            </div><!--Modal footer-->
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
</asp:Content>
